<!--
 * @Author: your name
 * @Date: 2022-03-10 14:06:08
 * @LastEditTime: 2022-03-10 14:21:13
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \day10\5-AJAX.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var xhr=new XMLHttpRequest();
        //打开一个链接  参数：请求方式  请求路径
        xhr.open('get','http://121.199.0.35:8888/index/carousel/findAll');
        //发送请求  
        xhr.send()
        //接受响应
        xhr.onreadystatechange=function(){
            if(xhr.readyState===4&xhr.status===200){
                console.log(xhr.response)
            }
        }
    </script>
</head>
<body>
    
</body>
</html>